using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace InvestmentIntelligence.DbModel.Models.Mapping
{
    public class SecurityClassMap : EntityTypeConfiguration<SecurityClass>
    {
        public SecurityClassMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Name)
                .IsRequired()
                .HasMaxLength(500);

            this.Property(t => t.EnumName)
                .IsRequired()
                .HasMaxLength(500);

            // Table & Column Mappings
            this.ToTable("SecurityClass", "MarketData");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Name).HasColumnName("Name");
            this.Property(t => t.EnumName).HasColumnName("EnumName");
            this.Property(t => t.Include).HasColumnName("Include");
            this.Property(t => t.IncludeEdge).HasColumnName("IncludeEdge");
        }
    }
}
